package cn.kinggm.controller;

import lombok.Data;
import org.example.annotation.Desensitization;
import org.example.base.DesensitizationTypeEnum;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/test")
public class TestController {

    @RequestMapping(value = "/a", method = RequestMethod.GET)
    public User test() {
        User user = new User();
        String phone = "18888888888";
        user.setPhone(phone);
        return user;
    }
}

@Data
class User {
    @Desensitization(type = DesensitizationTypeEnum.MOBILE_PHONE)
    private String phone;
}
